﻿using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace YArchitech.HVAC.WarmPipeSetting
{
	[Serializable]
	public class SystemTypeInfo
	{
		public bool IsParent { get; set; }

		public string SysType { get; set; }

		public string Abbreviation { get; set; }

		public string PipeType { get; set; }

		public string LineColor { get; set; }

		public string LinePattern { get; set; }

		public string LineWeight { get; set; }

		public string RPipeRadius { get; set; }

		public string SysCategory { get; set; }

		public int SortIndex { get; set; }

		public string GroupName { get; set; }

		public int GroupSortIndex { get; set; }

		public SystemTypeInfo DeepCopy()
		{
			object obj;
			using (MemoryStream memoryStream = new MemoryStream())
			{
				BinaryFormatter binaryFormatter = new BinaryFormatter();
				binaryFormatter.Serialize(memoryStream, this);
				memoryStream.Seek(0L, SeekOrigin.Begin);
				obj = binaryFormatter.Deserialize(memoryStream);
				memoryStream.Close();
			}
			return (SystemTypeInfo)obj;
		}

		public SystemTypeInfo Clone()
		{
			return (SystemTypeInfo)base.MemberwiseClone();
		}

		public bool IsEmptyPipingName()
		{
			return string.IsNullOrEmpty(this.SysType);
		}
	}
}
